<tagLib name="html,cx" />
<include file="Public:header" />
<div class="cbody b-box blank10">
	<include file="Public:menu" />
	<div class="b-area-w f_r">
	<switch name="dsp">
		<case value="add">
		<h4>添加产品</h4>
		<form name="proform" method="post" action="__URL__/adds" enctype="multipart/form-data">
		<table border="0" cellspacing="1" class="tb-b">
			<tr>
				<th>产品名称</th>
				<td><input type="text" name="title" value="" class="input-b" /><input type="hidden" name="uid" value="{$uid}"/></td>
			</tr>
			<tr>
				<th>产品类别</th>
				<td>
					<select name="cid" class="input-b">
						<volist name="cats" id="c"> 
							<option value="{$c.cid}">{$c.name}</option>
						</volist>
					</select>
				</td>
			</tr>
			<tr>
				<th>产品型号</th>
				<td><input type="text" name="pattern" value="" class="input-b" /></td>
			</tr>
			<tr>
				<th>产品图片</th>
				<td><input type="file"  name="attachment" value="" ></td>
			</tr>
			<tr>
				<th>产品介绍</th>
				<td><html:editor id="editor" name="content" type="FCKeditor" content="" /></td>
			</tr>
			<tr>
				<th>其他参数</th>
				<td><textarea name="parameters" class="input-textarea"></textarea></td>
			</tr>
		</table>
		<div align="center"><input type="submit" value="提交" class="input-btn-b" /></div>
		</form>
		</case>
		<case value="edit">
		<h4>编辑产品</h4>
		<form name="proform" method="post" action="__URL__/edits" enctype="multipart/form-data">
		<table border="0" cellspacing="1" class="tb-b">
			<tr>
				<th>ID</th>
				<td>{$pid}<input type="hidden" name="pid" value="{$pid}"></td>
			</tr>
			<tr>
				<th>产品名称</th>
				<td><input type="text" name="title" value="{$title}" class="input-b" /></td>
			</tr>
			<tr>
				<th>产品类别</th>
				<td>
					<select name="cid" class="input-b">
						<volist name="cats" id="c"> 
							<if condition="$c.cid eq $cid">
								<option value="{$c.cid}" selected="selected">{$c.name}</option>
							<else />
								<option value="{$c.cid}">{$c.name}</option>
							</if>
						</volist>
					</select>
				</td>
			</tr>
			<tr>
				<th>产品型号</th>
				<td><input type="text" name="pattern" value="{$pattern}" class="input-b" /></td>
			</tr>
			<tr>
				<th>产品图片</th>
				<td><input type="file"  name="attachment" value="{$attachment}" /> 当前图片：<a href="#" onmouseover="tooltip.show('<img src={$attachment|getProImg = ###} height=160 />');" onmouseout=tooltip.hide(); >{$attachment}</a></td>
			</tr>
			<tr>
				<th>产品介绍</th>
				<td><html:editor id="editor" name="content" type="FCKeditor" content="{$content}" /></td>
			</tr>
			<tr>
				<th>其他参数</th>
				<td><textarea name="parameters" class="input-textarea">{$parameters|str_replace = "<br />","",###}</textarea></td>
			</tr>
			<tr>
				<th>发布时间</th>
				<td><input type="text" name="postdate" value="{$postdate|date='Y-n-j H:i:s',###}" class="input-b" /></td>
			</tr>
		</table>
		<div align="center"><input type="submit" value="提交" class="input-btn-b" /></div>
		</form>
		</case>
		<default />
		<h4>产品管理</h4>
		<include file="Public:searchbar" />
		<form name="proform" method="post" action="__URL__/batch">
		<table width="100%" border="0" cellspacing="1" class="tb-a blank5">
			<tr>
				<th width="20"><input name="checkbox" type="checkbox" class="input-cb" onClick="selAll(this)" /></th>
				<th width="30">ID</th>
				<th>产品名称</th>
				<th>发布时间</th>
				<th>所属分类</th>
				<th width="150">操作</th>
			</tr>
			<volist name="products" id="p">
			<tr>
				<td><input name="id[]" type="checkbox" id="id[]" value="{$p.pid}" class="input-cb" /></td>
				<td>{$p.pid}</td>
				<td>{$p.title}</td>
				<td>{$p.postdate|date="Y-n-j H:i:s",###}</td>
				<td>{$p.name}</td>
				<td><a href="__URL__/edit/pid/{$p.pid}">编辑</a> <a href="__URL__/act/delete/id/{$p.pid}">删除</a></td>
			</tr>
			</volist>
			<tr>
				<td colspan="6" align="left">
					<input name="act" type="radio" value="delete" />删除
					<input name="act" type="radio" value="remove" />移动
					<select name="category" id="category">
						<volist name="cats" id="c"><option value="{$c.cid}">{$c.name}</option></volist>
					</select>
					<input type="submit" value="提交" class="input-btn-c" />
				</td>
			</tr>
		</table>
		</form>
		<include file="Public:paging" />
	</switch>
	</div>
	<div class="clear"></div>
</div>
<include file="Public:footer" />